﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EntModApp.EntServices.Data
{
  [Serializable]
  public class PagingSettings
  {
    public PagingSettings()
    {
      Paginate = false;
      pageSize = 10;
      pageIndex = 0;
    }

    public bool Paginate { get; set; }

    public bool ComputeTotal { get; set; }

    private int pageSize;
    public int PageSize 
    {
      get { return pageSize; }
      set 
      { 
        if (value < 1) throw new ArgumentOutOfRangeException("pageSize");
        pageSize = value;
      }
    }

    private int pageIndex;
    public int PageIndex 
    {
      get { return pageIndex; }
      set 
      {
        if (value < 0) throw new ArgumentOutOfRangeException("pageIndex");
        pageIndex = value;
      }
    }
  }
}
